package br.com.sigad.servlets.listener.email;

import javax.servlet.ServletContext;
import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

public class EnviarEmail implements ServletContextListener {
	private ServletContext context = null;

	public void contextDestroyed(ServletContextEvent arg0) {
		log("contexto destruido");
		context=null;
	}

	public void contextInitialized(ServletContextEvent arg0) {
		context=arg0.getServletContext();
		log("contexto iniciado");

	}

	private void log(String message) {

		if (context != null)
			context.log("SessionListener: " + message);
		else
			System.out.println("SessionListener: " + message);

	}

}
